diff options
| author | Jurjen de Vries <[email protected]> | 2025-09-11 00:48:15 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-11 00:48:15 +0200 |
| commit | 0c69c9848c6b98c92609d209103efc60003c9723 (patch) | |
| tree | 445121def885f13d0f80c06864ad2ff4d5ef95a1 /src/routes/(app)/[username]/(profile) | |
| parent | 2abcf6e435fca5d86960f3ba4228002bfb0a19e6 (diff) | |
| parent | 9277b2921e09ee9dd5f39cf4af30a2330f4d95d1 (diff) | |
| download | coinos-ui-0c69c9848c6b98c92609d209103efc60003c9723.tar.gz coinos-ui-0c69c9848c6b98c92609d209103efc60003c9723.zip | |
Merge branch 'coinos:master' into master
Diffstat (limited to 'src/routes/(app)/[username]/(profile)')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+layout.svelte | 87 | ||||
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+page.svelte | 46 |
2 files changed, 90 insertions, 43 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.svelte b/src/routes/(app)/[username]/(profile)/+layout.svelte index afd94ab0..b384344e 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.svelte +++ b/src/routes/(app)/[username]/(profile)/+layout.svelte @@ -16,12 +16,13 @@ } from "$lib/utils"; import { t } from "$lib/translations"; import { sign, send } from "$lib/nostr"; - import { bech32m } from "@scure/base"; + import { bech32 } from "@scure/base"; import { page } from "$app/stores"; + import { PUBLIC_DOMAIN } from "$env/static/public"; let { data, children } = $props(); - let { encode, toWords } = bech32m; + let { encode, toWords } = bech32; let { events, @@ -107,6 +108,17 @@ : `${stripped}@${$page.url.host}`, ); let profile = $derived(`${$page.url.host}/${subject.anon ? npub : stripped}`); + let lnurl = $derived( + encode( + "lnurl", + toWords( + new TextEncoder().encode( + `https://${PUBLIC_DOMAIN}/p/${subject.anon ? npub : stripped}`, + ), + ), + 20000, + ), + ); $effect(() => followList.then((l) => (list = l))); let following = $derived(list.some((t) => t.includes(subject.pubkey))); </script> @@ -116,19 +128,23 @@ <div class="w-full lg:w-[280px] xl:w-[360px] lg:absolute space-y-2 left-20 mx-auto" > - <button - type="button" - class="flex text-3xl font-bold text-center mx-auto justify-center gap-2" + <div + class="flex text-3xl font-bold text-center mx-auto justify-center gap-1 items-center" > - <div class="flex gap-1" onclick={toggleDetails}> - <div class="my-auto break-words">{display || username}</div> - <iconify-icon noobserver icon="ph:qr-code-bold" width="32" - ></iconify-icon> - </div> + <button class="flex gap-1 items-center" onclick={toggleDetails}> + <div class="break-words">{display || username}</div> + <iconify-icon noobserver icon="ph:list-bold" width="32"></iconify-icon> + </button> + {#if subject.id === user?.id} + <a href="/settings/profile" class="btn contents"> + <iconify-icon noobserver icon="ph:pencil-bold" width="32" + ></iconify-icon> + </a> + {/if} <!-- <a href={`/${subject.pubkey}/notes`}> --> <!-- <iconify-icon noobserver icon="ph:note-bold" width="32"></iconify-icon> --> <!-- </a> --> - </button> + </div> {#if subject.about} <div @@ -169,7 +185,7 @@ <!-- </div> --> {#if showDetails} - <div class="space-y-5 pb-20"> + <div class="space-y-5"> {#if lnaddr} <div> <div class="text-secondary">{$t("user.lightningAddress")}</div> @@ -214,18 +230,18 @@ </div> </div> <div> - <div class="text-secondary">{$t("user.nostrPubkey")}</div> + <div class="text-secondary">{$t("user.lnurl")}</div> <div class="flex gap-4"> <div class="break-all grow text-xl"> - {subject.pubkey} + {lnurl} </div> - <div class="flex my-auto gap-1"> - <button class="my-auto" onclick={() => copy(subject.pubkey)} + <div class="flex mb-auto gap-1"> + <button class="my-auto" onclick={() => copy(`lightning:${lnurl}`)} ><iconify-icon noobserver icon="ph:copy-bold" width="32" ></iconify-icon></button > <a - href={`/qr/${encodeURIComponent(subject.pubkey)}`} + href={`/${n}/accepted/${encodeURIComponent(`lightning:${lnurl}`)}`} class="my-auto" > <iconify-icon noobserver icon="ph:qr-code-bold" width="32" @@ -234,24 +250,24 @@ </div> </div> </div> - <div> - <div class="text-secondary">{$t("user.nostrPubkey")}</div> - <div class="flex gap-4"> - <div class="break-all grow text-xl"> - {npub} - </div> - <div class="flex my-auto gap-1"> - <button class="my-auto" onclick={() => copy(npub)} - ><iconify-icon noobserver icon="ph:copy-bold" width="32" - ></iconify-icon></button - > - <a href={`/qr/${encodeURIComponent(npub)}`} class="my-auto"> - <iconify-icon noobserver icon="ph:qr-code-bold" width="32" - ></iconify-icon> - </a> - </div> - </div> - </div> + <!-- <div> --> + <!-- <div class="text-secondary">{$t("user.nostrPubkey")}</div> --> + <!-- <div class="flex gap-4"> --> + <!-- <div class="break-all grow text-xl"> --> + <!-- {npub} --> + <!-- </div> --> + <!-- <div class="flex my-auto gap-1"> --> + <!-- <button class="my-auto" onclick={() => copy(npub)} --> + <!-- ><iconify-icon noobserver icon="ph:copy-bold" width="32" --> + <!-- ></iconify-icon></button --> + <!-- > --> + <!-- <a href={`/qr/${encodeURIComponent(npub)}`} class="my-auto"> --> + <!-- <iconify-icon noobserver icon="ph:qr-code-bold" width="32" --> + <!-- ></iconify-icon> --> + <!-- </a> --> + <!-- </div> --> + <!-- </div> --> + <!-- </div> --> </div> {/if} @@ -314,6 +330,7 @@ {#if currency} <div class="flex fixed w-full px-4 bg-base-100 py-2 pb-3 bottom-0 bg-opacity-90 tabular-nums" + style="bottom: calc(var(--safe-area-inset-bottom) + 8px);" > <div class="text-secondary flex mr-auto"> <div class="flex mr-1"> diff --git a/src/routes/(app)/[username]/(profile)/+page.svelte b/src/routes/(app)/[username]/(profile)/+page.svelte index bd421545..7d342994 100644 --- a/src/routes/(app)/[username]/(profile)/+page.svelte +++ b/src/routes/(app)/[username]/(profile)/+page.svelte @@ -6,7 +6,7 @@ import Account from "$comp/Account.svelte"; import Balance from "$comp/Balance.svelte"; import { t } from "$lib/translations"; - import { installPrompt } from "$lib/store"; + import { installPrompt, password } from "$lib/store"; import { afterNavigate, preloadData } from "$app/navigation"; import { page } from "$app/stores"; @@ -18,6 +18,7 @@ }); let { accounts, subject, rate, user } = $derived(data); + let { locked } = $derived(user); let install = async () => { if (!$installPrompt) return; @@ -31,6 +32,35 @@ </script> <div class="space-y-2"> + {#if user?.destination && !user?.autowithdraw} + <div class="rounded-2xl space-y-2 p-4 shadow-lg"> + <h1 class="text-3xl font-bold"> + {$t("user.settings.confirmAutoWithdrawal")} + </h1> + <div> + {$t("user.settings.confirmAutoWithdrawalDesc")} + </div> + + <a href="/settings/account" class="btn"> + <iconify-icon icon="ph:gear-bold" width="32"></iconify-icon> + Settings</a + > + </div> + {/if} + {#if user?.fresh} + <div> + {$t("user.settings.yourUsername")} <b>{user?.username}</b> + {#if $password} + <br /> + {$t("user.settings.yourPassword")} + <b>{$password}</b>{/if} + </div> + + <a href="/settings/profile" class="btn"> + <iconify-icon icon="ph:gear-bold" width="32"></iconify-icon> + {$t("user.settings.continueSettingUp")}</a + > + {/if} {#if user?.id && user.id === subject.id} <div class="space-y-5" data-sveltekit-preload-data="false"> {#each accounts as account, i} @@ -38,13 +68,11 @@ {/each} </div> - <a href={`/account/savings`} class="contents"> - <button class="btn btn-lg w-full rounded-2xl whitespace-nowrap"> - <iconify-icon noobserver icon="ph:plus-circle-bold" width="32" - ></iconify-icon> - {$t("accounts.addAccount")} - </button> - </a> + {#if locked} + <div class="text-sm"> + {$t("incident")} + </div> + {/if} {#if $installPrompt} <button class="btn btn-accent lg:hidden" onclick={install}> @@ -56,6 +84,8 @@ {/if} </div> +<!-- <a href="/funder" class="btn">Funder</a> --> + <div class="fixed inset-x-0 mx-auto flex bottom-16 px-4"> {#if user?.username !== subject.username && (!subject.anon || subject.lud16)} <a |
